﻿@using DistanceLearning.Controllers
@using DistanceLearning.Models
<div class="headerTop">
    <div class="templateTitle">
        @Html.ActionLink(@"Портал ""Диалог""", "Index", "Home")
        @*<img src="~/Images/portal.jpg" alt="альтернативный текст" />*@
    </div>
    <div class="loginControl">
        @Html.Partial("_LoginPartial")
    </div>
</div>
<div class="headerMenu">
    @* DXCOMMENT: Configure the header menu *@
	@Html.DevExpress().Menu(settings => {
        settings.Name = "HeaderMenu";
    
        settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
        settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
        settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
    //ViewContext.Controller
    //this.Profile.IsAnonymous
    var controller = ViewContext.Controller as JournalBaseController;
    settings.Items.Add(new MVCxMenuItem {Text="Домашняя", NavigateUrl="/Home/Index"});

    if (WebSecurity.CurrentUserId != -1)
    {
        if (controller.UserKind == UserKind.Admin || controller.UserKind == UserKind.SchoolAdmin)
            settings.Items.Add(new MVCxMenuItem { Text = "Администрирование", NavigateUrl = "/Administration/Administration" });

        if (controller.UserKind == UserKind.Admin || controller.UserKind == UserKind.SchoolAdmin || controller.UserKind == UserKind.Teacher)
            settings.Items.Add(new MVCxMenuItem { Text = "Журнал", NavigateUrl = "/Journal/Index" });
    }


    settings.Items.Add(new MVCxMenuItem { Text = "Тесты", NavigateUrl = "/ExamTest/Index" });

    
    settings.Items.Add(new MVCxMenuItem { Text = "Контакты", NavigateUrl = "/Home/Contact" });
    }).GetHtml()
</div>